import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from './http'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.prototype.$axios = axios;


//转换时间格式
function formateDate(datetime) {
  function addDateZero(num) {
      return (num < 10 ? "0" + num : num);
  }
  let d = new Date(datetime);
  let formatdatetime = d.getFullYear() + '-' + addDateZero(d.getMonth() + 1) + '-' + addDateZero(d.getDate()) + ' ' + addDateZero(d.getHours()) + ':' + addDateZero(d.getMinutes()) + ':' + addDateZero(d.getSeconds());
  return formatdatetime;
}
Vue.filter('formateDate',formateDate);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
